global class RescheduleEmailVelocityJobHandler
{
    private Integer window;
    private Integer start;
    private Integer thresh;
    
    global RescheduleEmailVelocityJobHandler(Integer start, Integer window, Integer thresh)
     {
        this.window = window;  
        this.start = start;  
        this.thresh = thresh;
    }
    
    global void Reschedule(String jobId)
    {
        CronTrigger ct = [SELECT id, CronExpression FROM CronTrigger WHERE id = :jobId];
        String cron = ct.CronExpression; 
        
        EmailVelocityHandler ev = new EmailVelocityHandler();
        List<EmailVelocityHandler.Hist> items = ev.handle(window, thresh);
        if (items.size() >= 1)
            emailVelocity.send(items);
        
        // kill current scheduled job and start a new one  
        String[] b = cron.split(' ',0);
        Integer i = math.mod((integer.valueOf( b[1]) + this.window), 60);
        List<String> ick = new List<String> {String.valueOf(i)};
        String newCron = String.format('0 {0} * * * ?', ick);
        System.debug(newCron);
        System.abortJob(jobId);
        EmailVelocityCheckScheduler.start(i, window, thresh);
    }
}